Magnetic elements have been widely used in consumer electronic devices (such as iPad, tablets, smart phones, laptops, etc.) and their accessories to provide various unique functions. In order to utilize these magnets, magnetically sensitive sensors within an electronic device can be used to sense magnetic fields provided by the magnetic elements. The placement of the magnetic elements with respect to the magnetically sensitive sensors can be used to determine a relative position of an external magnetic element for example with respect to the electronic device. The relative position of the external magnetic element can, in turn, be used to alter an operation of the electronic device. For example, a strategically placed magnet when detected by an appropriately placed magnetically sensitive sensor can indicate that the electronic should be operable in a particular operating mode (such as sleep, wake, etc.).